var ticketService = {
  getInfo: function() {
    var param = {
      expressId: common.getUrlParams("expressId")
    }
    var dataList = [];
    var noFeeRule = {}; //不收取手续费的参数
    var noRefoundRule = {}; //不允许退款的参数
    var rulesArr = []; //收取手续费的参数
    console.log(param)
    common.get({
      url: "/ruleOfRefund.shtml",
      data: param,
      callback: function(result) {
        if(result.code == 200) {
          dataList = result.data;
          if(dataList.length > 0) {
          	$("#defaultText").addClass("none")
            noFeeRule = dataList[0]
            if(dataList.length == 2) {
              noRefoundRule = dataList[1]
              rulesArr = [];
            } else if(dataList.length > 2) {
              rulesArr = [];
              for(var i = 1; i < dataList.length - 1; i++) {
                if(dataList[i].calculateType == "RATE") {
                  dataList[i].amount = dataList[i].amount
                }
                rulesArr.push(dataList[i])
              }
              noRefoundRule = dataList[dataList.length - 1]
            }
            $("#noFeeRuleInfo").tmpl(noFeeRule).appendTo('#noFeeRuleBox');
            $("#ruleRefundInfo").tmpl(rulesArr).appendTo('#ruleRefundInfoBox');
            $("#noRefoundRuleInfo").tmpl(noRefoundRule).appendTo('#noRefoundRuleBox');
          }else{
          	$("#defaultText").removeClass("none")
          }
        }
      }
    });
  }
}
ticketService.getInfo()